﻿using OpenAdmin.Application.Services.Dtos;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace OpenAdmin.Application.Services
{
    /// <summary>
    /// 权限相关功能接口
    /// </summary>
    public interface IPermissionService
    {
        /// <summary>
        /// 获取指定用户权限
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="ignoreQueryFilters"></param>
        /// <param name="hasSuperAdmin"></param>
        /// <returns></returns>
        Task<List<UserPermissionResponseDto>> GetUserPermissions(int userId, bool ignoreQueryFilters = false, bool hasSuperAdmin = false);

        /// <summary>
        /// 获取权限列表
        /// </summary>
        /// <returns></returns>
        Task<List<PermissionResponseDto>> GetPermissions();

        /// <summary>
        /// 获取角色权限列表
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<RolePermissionResponseDto> GetRolePermissions(int roleId);

        /// <summary>
        /// 获取租户权限列表
        /// </summary>
        /// <param name="tenantId"></param>
        /// <returns></returns>
        Task<TenantPermissionResponseDto> GetTenantPermissions(Guid tenantId);

        /// <summary>
        /// 获取用户权限菜单
        /// </summary>
        /// <returns></returns>
        Task<List<PermissionMenuResponseDto>> GetUserPermissionMenus();

        /// <summary>
        /// 保存角色权限
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        Task SaveRolePermission(SaveRolePermissionRequestDto requestDto);

        /// <summary>
        /// 保存租户系统管理呗权限
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        Task SaveTenantPermission(SaveTenantPermissionRequestDto requestDto);
    }
}
